package com.hospital.doctor.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.hospital.common.result.R;
import com.hospital.doctor.domain.ConsultRecordInfo;
import com.hospital.doctor.domain.vo.ConsultRecordVo;
import com.hospital.doctor.service.EltConsultRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * @Author：zhuzhujiang
 * @Description:
 * @name：EltConsultRecordController
 * @Date：2024/10/17 20:57
 */
@RestController
@RequestMapping("/consultRecord")
public class EltConsultRecordController {


    @Autowired
    private EltConsultRecordService eltConsultRecordService;

    /**
     * 获取医生当天患者的预约记录
     */
    @GetMapping("/getConsultRecord/{departmentId}")
    public R<List<ConsultRecordVo>> getConsultRecord(@PathVariable("departmentId")Long departmentId) {


        List<ConsultRecordVo> list = eltConsultRecordService.getConsultRecord(departmentId);


        return R.success(list);
    }


    /**
     * 医生向用户发送准备就诊信息
     */
    @GetMapping("/startConsult/{consultId}")
    public R sendToPatient(@PathVariable("consultId") Long consultId){

        ConsultRecordInfo consultRecordInfo = new ConsultRecordInfo();
        consultRecordInfo.setId(consultId);
        consultRecordInfo.setDoctorConfirm(1);

        return R.success();
    }


    /**
     * 结束问诊  根据id修改咨询订单
     */
    @PostMapping("/finishConsult")
    public R finishConsult(@RequestBody ConsultRecordInfo consultRecordInfo){

        consultRecordInfo.setStatus(2);

        eltConsultRecordService.finishConsult(consultRecordInfo);

        return R.success("结束问诊");
    }







}
